Skip to content

[Newton] Declare physics presets for warp-only experimental envs#5974

Closed
hujc7 wants to merge 1 commit into
isaac-sim:developfrom
hujc7:jichuanh/exp-warp-physics-presets
Closed

[Newton] Declare physics presets for warp-only experimental envs#5974
hujc7 wants to merge 1 commit into
isaac-sim:developfrom
hujc7:jichuanh/exp-warp-physics-presets

Conversation

@hujc7

@hujc7 hujc7 commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

1. Summary

  • 18 warp env configs in isaaclab_tasks_experimental assigned a bare NewtonCfg straight to sim.physics, bypassing the PresetCfg mechanism — so they declared no default and did not participate in presets= resolution like the migrated core envs.
  • Each now wraps physics in a module-level PhysicsCfg(PresetCfg) with a newton_mjwarp variant and default aliasing it (warp-only, so no PhysX default is invented), matching the core/velocity convention.
  • Direct envs additionally had stray solver_cfg / newton_cfg class attributes (confirmed unreferenced) lifted into the preset class.
  • No behavior change: with no preset and with presets=newton_mjwarp, resolution returns the same NewtonCfg these envs used before.

2. Scope

  • Locomotion velocity flat (9): a1, anymal_b, anymal_c, anymal_d, cassie, g1, go1, go2, h1
  • Manipulation reach (2): franka, ur_10 (SimulationCfg dt preserved)
  • Classic manager-based (3): ant, cartpole, humanoid (humanoid builds physics in __post_init__)
  • Direct warp (4): allegro_hand_warp_env_cfg, and the split cfg files ant/ant_env_warp_cfg, cartpole/cartpole_warp_env_cfg, humanoid/humanoid_warp_env_cfg (allegro's physics_material preserved)

3. Pattern

@configclass
class PhysicsCfg(PresetCfg):
    newton_mjwarp = NewtonCfg(
        solver_cfg=MJWarpSolverCfg(...),
        num_substeps=1,
        debug_mode=False,
    )
    default = newton_mjwarp

4. Test plan

@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Jun 4, 2026

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Isaac Lab Review Bot

Summary

This PR migrates 18 warp-only experimental environment configs from directly assigning a bare NewtonCfg to sim.physics to using the PresetCfg mechanism. Each file now declares a module-level PhysicsCfg(PresetCfg) class with a newton_mjwarp variant and default aliasing it, matching the convention already used in core/velocity envs. For direct envs, stray solver_cfg/newton_cfg class attributes are lifted into the preset class.

Findings

No issues found.

Details of review:

  1. Consistent pattern — All 18 files follow the identical refactoring pattern: extract physics config into a PhysicsCfg(PresetCfg) class → expose newton_mjwarp → alias default = newton_mjwarp → pass PhysicsCfg() to SimulationCfg(physics=...).

  2. Parameter preservation — Solver parameters (njmax, nconmax, cone, impratio, integrator, num_substeps, debug_mode, etc.) are preserved byte-for-byte in all files. No accidental parameter changes detected.

  3. Special cases handled correctly:

    • allegro_hand_warp_env_cfg.py: physics_material (static/dynamic friction) preserved in SimulationCfg.
    • franka/joint_pos_env_cfg.py: Custom dt=1/60 preserved.
    • humanoid_env_cfg.py (manager-based classic): __post_init__ assignment with dt=1/120.0 preserved.
    • anymal_d: Note that this config does not specify integrator (unlike most others that use "implicitfast"), which matches the pre-existing behavior.
  4. No behavioral changePhysicsCfg() instantiation resolves defaultnewton_mjwarp → identical NewtonCfg as before. Both presets=newton_mjwarp and no-preset paths resolve to the same config.

  5. Import consistencyfrom isaaclab_tasks.utils import PresetCfg added cleanly in all 18 files.

Verdict

No issues found — Clean mechanical refactoring with no behavioral change. The PR correctly brings all 18 warp-only experimental envs into the PresetCfg mechanism.


Update (106a544): Large batch of changes merged into this PR branch (version bumps, changelog consolidation, lazy-export refactoring in isaaclab_experimental, ls_parallel deprecation in MJWarpSolverCfg, new NewtonSDFCollisionPropertiesCfg, task path renames, sim_launcher addition, etc.). None of these changes conflict with or alter the original physics preset refactoring for the 18 warp-only envs. The ls_parallel deprecation is consistent — configs that previously set ls_parallel=False will now simply have the field ignored via the new __post_init__ guard. No new issues introduced.

@greptile-apps

greptile-apps Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR migrates 18 warp-only experimental environment configs from bare NewtonCfg physics assignments to the PhysicsCfg(PresetCfg) preset mechanism, bringing them in line with the core/velocity convention already established in non-experimental envs. No solver parameters changed; the refactoring is purely structural.

  • Locomotion (9) + Manipulation (2) + Classic (3) manager-based envs: Each file gains a module-level PhysicsCfg class with a single newton_mjwarp variant and default = newton_mjwarp, then passes PhysicsCfg() to SimulationCfg(physics=...).
  • Direct warp envs (4): Same preset class added; additionally the stray solver_cfg / newton_cfg class attributes on the env config class body are removed (confirmed unreferenced). Allegro's physics_material and all dt= values are faithfully preserved.

Confidence Score: 5/5

Safe to merge — purely structural refactoring with no solver parameter changes and no new runtime paths.

Every changed file applies the same well-established PhysicsCfg(PresetCfg) pattern already validated in core envs. Solver parameters are faithfully transcribed, removed class attributes were confirmed unreferenced, and the physics_material / dt values are preserved where they existed. The default = newton_mjwarp alias is explicitly documented in PresetCfg's own docstring, so no novel mechanism is introduced.

No files require special attention; the 4 direct env files had the largest structural change (attribute removal) but these attributes were unused.

Important Files Changed

Filename Overview
source/isaaclab_tasks_experimental/isaaclab_tasks_experimental/direct/allegro_hand/allegro_hand_warp_env_cfg.py Adds PhysicsCfg preset class; removes stray solver_cfg/newton_cfg class attrs; physics_material and dt preserved in SimulationCfg.
source/isaaclab_tasks_experimental/isaaclab_tasks_experimental/direct/ant/ant_env_warp.py Adds PhysicsCfg preset; removes stray solver_cfg/newton_cfg class attrs; sim dt and use_cuda_graph preserved.
source/isaaclab_tasks_experimental/isaaclab_tasks_experimental/direct/cartpole/cartpole_warp_env.py Adds PhysicsCfg preset; removes stray class attrs; parameters faithfully transcribed.
source/isaaclab_tasks_experimental/isaaclab_tasks_experimental/direct/humanoid/humanoid_warp_env.py Adds PhysicsCfg preset; removes stray class attrs; use_cuda_graph and update_data_interval preserved.
source/isaaclab_tasks_experimental/isaaclab_tasks_experimental/manager_based/classic/humanoid/humanoid_env_cfg.py PhysicsCfg defined module-level; SimulationCfg(dt=1/120.0, physics=PhysicsCfg()) assigned in post_init, faithfully matching original.
source/isaaclab_tasks_experimental/isaaclab_tasks_experimental/manager_based/manipulation/reach/config/franka/joint_pos_env_cfg.py Adds PhysicsCfg preset; dt=1/60 preserved in SimulationCfg.
source/isaaclab_tasks_experimental/isaaclab_tasks_experimental/manager_based/manipulation/reach/config/ur_10/joint_pos_env_cfg.py Adds PhysicsCfg preset; no dt was specified originally and remains absent.
source/isaaclab_tasks_experimental/isaaclab_tasks_experimental/manager_based/locomotion/velocity/config/anymal_d/flat_env_cfg.py Adds PhysicsCfg preset; pre-existing omission of integrator parameter preserved (not a new change).

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[EnvCfg class] -->|sim=| B["SimulationCfg(physics=PhysicsCfg())"]
    B -->|physics| C["PhysicsCfg(PresetCfg)"]
    C -->|newton_mjwarp| D["NewtonCfg(solver_cfg=MJWarpSolverCfg(...))"]
    C -->|default| D
    E["No preset CLI arg"] -->|resolves via 'default'| D
    F["presets=newton_mjwarp"] -->|resolves via name| D
    style C fill:#d4edda,stroke:#28a745
    style D fill:#cce5ff,stroke:#004085
Loading

Reviews (1): Last reviewed commit: "Declare physics presets for warp-only ex..." | Re-trigger Greptile

The warp env configs under isaaclab_tasks_experimental assigned a bare
NewtonCfg directly to sim.physics, bypassing the PresetCfg mechanism. As
a result they declared no default and did not participate in `presets=`
resolution the way the migrated core envs do.

Wrap each env's physics in a module-level PhysicsCfg(PresetCfg) exposing
a newton_mjwarp variant with default aliasing it, matching the
core/velocity convention. For the direct envs, lift the stray solver_cfg
and newton_cfg class attributes into the preset class.
@hujc7
hujc7 force-pushed the jichuanh/exp-warp-physics-presets branch from 57fb835 to 106a544 Compare June 4, 2026 23:00
@kellyguo11

Copy link
Copy Markdown
Contributor

are presets necessary if they only support one backend?

@hujc7
hujc7 marked this pull request as draft June 5, 2026 16:27
@hujc7

hujc7 commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator Author

are presets necessary if they only support one backend?

So there are two ways I think

  1. I have [WARP] Cleanup Part 1: Add frontend bridge for stable manager-based tasks #5504 which bridges warp env to torch env, which reuses the torch cfg.
  2. There's a QA bug where they are trying to run warp envs following the same preset pattern as torch envs and it complains that newton_mjwarp does not exist, which was then reported as a bug. To some extent, aligning the usage could be beneficial. @AntoineRichard mentioned kamino is coming so this will need preset later.

@hujc7

hujc7 commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #5504: it removes all 18 duplicated warp env configurations this PR patches. The warp frontend now runs stable task ids with the stable configurations, whose PresetCfg physics blocks already provide presets= resolution — the bypass this PR fixed no longer exists.

@hujc7 hujc7 closed this Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants